<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查看商品</title>
<script language="javascript">
function addattribute(goods_id)
{
	$("#goods_id").val(goods_id);
	$('#addattributeform').modal('show');	
}
$(document).ready(function(){
	getsecondcate('{{$goods.g_secondclassid}}');
	getthirdcate('{{$goods.g_secondclassid}}','{{$goods.g_threeclassid}}');
});

</script>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">查看商品</h1>
      <span class="pagedesc"></span>
      <div class="menulist">
        <ul class="profile_summary">
        </ul>
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
        <form class="stdform stdform2">
       
      
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
              <tr>
                <th class="head1">商品图片</th>
                
              </tr>
            </thead>
          </table>
           <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
              <thead>
              <tr>
			{{foreach from=$goods_images item=res name=loop key=key}}
              
                <td class="head1" style="position:relative;">
                {{if $res.local_url}}
                <a href="/{{$res.local_url}}" target="_blank"><img src="/{{$res.local_url}}" width="200"></a>
                {{else}}
                 <a href="{{$res.images_url}}" target="_blank"><img src="{{$res.images_url}}" width="200"></a>
                {{/if}}
                {{if $smarty.foreach.loop.iteration mod 6 ==0}}</tr><tr>{{/if}}</td>
              
              {{/foreach}}
              </tr>
             </thead>
          </table>
             <br>
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
              <tr>
                <th colspan="2" class="head1">基本信息</th>
              </tr>
            </thead>
          </table>
        <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <tbody>
              <tr>
                <td class="head1" width="120">商品分类 *</td>
                <td colspan="3" class="head0">{{$bigname}}->{{$secondclassid}}{{if $g_threeclassid}}->{{$g_threeclassid}}{{/if}}</td>
              </tr>
               <tr>
                <td class="head1">商品SKU *</td>
                <td colspan="3" class="head0">{{$goods.goods_sku}}</td>
              </tr>
               <tr>
                <td class="head1">商品名称</td>
                <td colspan="3" class="head0">{{$goods.goods_name}}</td>
              </tr>
              <tr>
                <td class="head1">英文名称</td>
                <td colspan="3" class="head0">{{$goods.en_goods_name}}</td>
              </tr>
               <tr>
                <td class="head1">商品品牌</td>
                <td class="head0">{{$goods.goods_brand}}</td>
                <td class="head0" width="120">库存警戒天数</td>
                <td class="head1">{{$goods.g_inventory_day}}{{if $goods.dailysales>0}}日均销量：{{$goods.dailysales}}{{/if}}</td>
              </tr>
               <tr>
                <td class="head1">采购天数</td>
                <td class="head0">{{$goods.g_procurement}}</td>
                <td class="head0" width="120">零售价</td>
                <td class="head1">{{$goods.g_sellprice}}（元）</td>
              </tr>
              <tr>
                <td class="head1">重量</td>
                <td class="head0">{{$goods.g_weight}}</td>
                <td class="head0" width="120">出厂价</td>
                <td class="head1">{{$goods.g_costprice}}（元）</td>
              </tr>
               <tr>
                <td class="head1">申报价值</td>
                <td class="head0">{{$goods.g_pd_declare_value}}</td>
                <td class="head0" width="120">工时</td>
                <td class="head1">
                {{$goods.wages}}（元）
              </td>
              </tr>
               <tr>
                  <td class="head1">采购员</td>
                  <td class="head0">
                    {{$goods.g_buyer}}
                  
                 </td>
                  <td class="head1">关联价</td>
                <td class="head0">{{$goods.bulkprice}}（元）</td>
                </tr>
               <tr>
                <td class="head1">尺寸(CM) </td>
                <td class="head0" >长：
                 {{$goods.g_pd_length}}
                  宽：
                 {{$goods.g_pd_width}}
                  高：
                  {{$goods.g_pd_height}}</td>
                <td class="head1"><span class="head0">销售状态</span></td>
                <td class="head0" > 
              
                    {{foreach from=$salestatus item=res key=key}}
                   {{if $goods.g_sale_status==$key}}{{$res}} {{/if}}
                    {{/foreach}}
                </td>
              </tr>
               <tr>
                 <td class="head1">供货商</td>
                 <td class="head0">
                    {{foreach from=$factory item=res key=key}}
                    {{if $res.id == $goods.g_supplier}} {{$res.name}}{{/if}}
                    {{/foreach}}
                  </td>
                 <td class="head1">开发人员 </td>
                 <td class="head0">
                    {{$goods.g_checkman}}
                  </td>
               </tr>
             
              {{if $goods.g_goodstypeID>0}}
                <tr>
                  <td class="head1">属性值</td>
                  <td class="head0" colspan="3">
                   <input type="hidden" name="goodstypeID" value="{{$goods.g_goodstypeID}}">
                  	  {{foreach from=$attributelist item=res key=key}}
                      		{{$res.attr_name}}	
       			 
                    {{foreach from=$res.selectvaluelist item=rd key=rkey}}
                    {{if $rd == $res.selectvalue}} {{$rd}} {{else}}{{/if}}
                    {{/foreach}}
                  
                      
                      	
                      {{/foreach}}
                  </td>
                </tr>
               {{/if}}
               
                <tr>
                <td class="head1">质检标准</td>
                <td class="head0" colspan="3">
                {{$goods.standard}}
                </td>
               
              </tr>
                <tr>
                <td class="head1">面料信息</td>
                <td class="head0" colspan="3">
                {{$goods.fabricinfo}}
                </td>
              </tr>
               <tr>
                <td class="head1">备注信息</td>
                <td class="head0" colspan="3">
                {{$goods.memo}}
                </td>
              </tr>
              
             </tbody>
           </table>
        
         <br>
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
              <tr>
                <th class="head1">库存信息 </th>
                
              </tr>
            </thead>
          </table>
           <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
              <tr>
                <th class="head1">仓库 </th>
                <th class="head1">在库数 </th>
                <th class="head1">在途数</th>
                <th class="head1">仓位</th>
              </tr>
            </thead>
              <tbody>
            
			{{foreach from=$storage item=res name=loop key=key}}
                <tr>
                <td class="head1" style="position:relative;">{{$res.storage_name}}</td>
                <td class="head1" style="position:relative;">{{$res.stock}}</td>
                <td class="head1" style="position:relative;">{{$res.in_transit}}</td>
                <td class="head1" style="position:relative;" width="20%">
               {{$res.positions}}
                </td>
               </tr>
              {{/foreach}}
             
             </tbody>
          </table>
        
        <br>
        
        {{if $classid ==12 || $classid ==13}}
        
        	{{else}}
          {{if $orderhistoryList}}

<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr>
    <th colspan="8" class="head1">历史订单</th>
    <th  class="head1" align="right"><a href="/order/ajaxbutton?op=showhistoryOrder&goods_id={{$goods.goods_id}}" target="_blank">More</a> {{if $goods.fbasale1 || $goods.fbasale2 || $goods.fbasale3}}
    | <a href="/order/amazonfba?goods_id={{$goods.goods_id}}" target="_blank">FBA历史订单</a>
    {{/if}}</th>
  </tr>
</thead>
<tbody >
<thead>
  <tr class="lbbt">
     <td bgcolor="#FEFFF1" >订单编号</td>
    <td  bgcolor="#FEFFF1" >店铺</td>
    <td  bgcolor="#FEFFF1" >状态</td>
    <td  bgcolor="#FEFFF1">买家帐号</td>
    <td  bgcolor="#FEFFF1" >订单金额</td>
    <td  bgcolor="#FEFFF1">货运方式</td>
    <td bgcolor="#FEFFF1">货运单号</td>
 <td  bgcolor="#FEFFF1">订单时间</td>
 <td  bgcolor="#FEFFF1" >发货时间</td>
  </tr>
</thead>
{{foreach from=$orderhistoryList item=li key=key}}
<tr>
  <td valign="middle"  style="position:relative;"><a href="/orderlist/editorder?order_id={{$li.order_id}}" target="_blank">{{$li.order_sn}}</a></td>
  <td>{{$li.shopname}}</td>
  <td valign="middle" >{{if $li.order_status==1}}新订单{{/if}}
  {{if $li.order_status==2}}已支付{{/if}}
  {{if $li.order_status==3}}配货中{{/if}}
  {{if $li.order_status==4}}已发货{{/if}}
  {{if $li.order_status==5}}已完成{{/if}}
  {{if $li.order_status==6}}已作废{{/if}}</td>
  <td valign="middle" >{{$li.customerid}}</td>
  <td valign="middle" >{{$li.goods_amount}}</td>
  <td valign="middle" >{{$li.shipping_name}}</td>
    <td valign="middle" >{{$li.shipping_number}}</td>
  <td valign="middle" >{{$li.ordertime}}</td>
  <td valign="middle" >{{$li.expresstime}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
<br>
{{/if}} 

{{if $orderhistoryList=="" && $getorderhistoryFBAList}}
	
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
 <tr>
    <th colspan="8" class="head1">FBA历史订单</th>
    <th  class="head1" align="right">
   <a href="/order/amazonfba?goods_id={{$goods.goods_id}}" target="_blank">FBA历史订单</a>
   
    </th>
  </tr>
</thead>
<tbody >
<thead>
  <tr class="lbbt">
     <td bgcolor="#FEFFF1" >订单编号</td>
    <td  bgcolor="#FEFFF1" >店铺</td>
    <td  bgcolor="#FEFFF1" >状态</td>
    <td  bgcolor="#FEFFF1">买家帐号</td>
    <td  bgcolor="#FEFFF1" >订单金额</td>
    <td  bgcolor="#FEFFF1">货运方式</td>
    <td bgcolor="#FEFFF1">货运单号</td>
 <td  bgcolor="#FEFFF1">订单时间</td>
 <td  bgcolor="#FEFFF1">发货时间</td>
  </tr>
</thead>
{{foreach from=$getorderhistoryFBAList item=li key=key}}
<tr>
  <td valign="middle"  style="position:relative;"><a href="/order/editFBAorder?order_id={{$li.id}}" target="_blank">{{$li.tradeid}}</a></td>
  <td>{{$li.shopname}}</td>
  <td valign="middle" >已完成</td>
  <td valign="middle" >{{$li.custid}}</td>
  <td valign="middle" >{{$li.goods_amount}}</td>
  <td valign="middle" >FBA</td>
   <td valign="middle" >AFN</td>
  <td valign="middle" >{{$li.ordercreatetime}}</td>
  <td valign="middle" >{{$li.expresstime}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
<br>
{{/if}} 

{{/if}} 
          <br>
          {{if $goods_log}}
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
               <tr>
                <th class="head1">商品日志 </th>
                 <th class="head1" align="right">
                 <div align="right" style="padding-right:50px;"><a href="/order/ajaxbutton?op=showhistorylog&goods_id={{$goods.goods_id}}" target="_blank">More</a></div></th>
              </tr>
            </thead>
          </table>
           <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
           <tr>
              <td>时间</td>
              <td>内容</td>
              <td>执行者</td>
            </tr>
             <tbody style="height:100px; overflow:auto">
			{{foreach from=$goods_log item=res name=loop key=key}}
            	 <tr>
              <td width="10%">{{$res.updatetime}}</td>
              <td width="80%">{{$res.content}}</td>
              <td width="5%">{{$res.createUser}}</td>
                </tr>
              {{/foreach}}
             </tbody>
             
          </table>
          	{{/if}}
           <br>
         
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <thead>
              <tr>
                <td><button type="submit" class="btn btn-primary" onClick="history.go(-1)" > 返回 </button>
                 {{if $managers || in_array('79',$showpower)}}
                 {{if $goods.yz==0}}
     &nbsp;&nbsp;&nbsp;<span><a href="/product/editProduct?goods_id={{$goods.goods_id}}"><button type="button" class="btn btn-primary" > 编辑 </button></a></span>
     {{/if}}
     {{/if}} 
				  

                </td>
              </tr>
             
            </thead>
           
          </table>
        </form>
        <br />
      </div>
      <!--subcontent--> 
      
      <!--subcontent--> 
      
    </div>
    <!--contentwrapper--> 
    
  </div>
  <!-- centercontent --> 
  
</div>


<!-- 模态框（Modal）添加商品图片 -->
<form action="/product/ajaxbutton?op=upimages" enctype="multipart/form-data"  method="post" name="otherform" id="otherform" >
<input type="hidden" name="goods_id" id="goods_id">
  <div class="modal fade" id="addattributeform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform"> 上传图片(图片格式只允许 JPG GIF和PNG) </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>上传： </td>
              <td align="left"><input type="file" name="userfile[1]" id="userfile1" /> <a href="javascript:void(0)"  onClick="showinput('fileinput')" class="btn btn_book"><span>添加一张图片</span></a></td>
            </tr>
            <tbody id="fileinput"></tbody>
          
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('otherform','addattributeform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）添加商品图片 -->

</body>
</html>